package day04;

import java.util.Scanner;

public class MainTest6 {
    public static void main(String[] args) {

//        循环录入某学生5门课的成绩并计算平均分，
//        如果某分数录入为负，停止录入并提示录入错误
        int sum=0;
        for (int i=1;i<=5;i++) {
            System.out.println("请输入第" + i + "课的成绩：");
            Scanner input = new Scanner(System.in);
            int scorse = input.nextInt();

            if (scorse<0){
                System.out.println("录入错误。");

                break;
            }
            sum=sum+scorse;
            System.out.println("总分：");
            System.out.println(sum/5);

        }

    }
}
